Add a test for ltr vs rtl boxes.
authorMatthias Clasen <mclasen@redhat.com>
Wed, 6 Jan 2016 04:24:51 +0000 (23:24 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 6 Jan 2016 19:57:42 +0000 (14:57 -0500)
This tests that horizontal boxes flip their child nodes
according to text direction to maintain the left-to-right
ordering of child nodes for both text directions.

testsuite/css/nodes/Makefile.am
testsuite/css/nodes/box.ltr.nodes [new file with mode: 0644]
testsuite/css/nodes/box.ltr.ui [new file with mode: 0644]
testsuite/css/nodes/box.rtl.nodes [new file with mode: 0644]
testsuite/css/nodes/box.rtl.ui [new file with mode: 0644]

index 13130b83eb1c01bbfd4288a56df10a7ff0b53883..b73a844e31acc42c9d69ce5b2930d6b8bc2c9240 100644 (file)
@@ -28,6 +28,8 @@ test_css_nodes_SOURCES = \
        $(NULL)
 
 test_data = \
+       box.ltr.ui      box.ltr.nodes           \
+       box.rtl.ui      box.rtl.nodes           \
        buttons.ui      buttons.nodes           \
        entries.ui      entries.nodes           \
        levelbar.ui     levelbar.nodes          \
diff --git a/testsuite/css/nodes/box.ltr.nodes b/testsuite/css/nodes/box.ltr.nodes
new file mode 100644 (file)
index 0000000..fae4431
--- /dev/null
@@ -0,0 +1,6 @@
+[window.background:dir(ltr)]
+  decoration:dir(ltr)
+  box.horizontal:dir(ltr)
+    label#label1:dir(ltr)
+    label#label2:dir(ltr)
+    label#label3:dir(ltr)
diff --git a/testsuite/css/nodes/box.ltr.ui b/testsuite/css/nodes/box.ltr.ui
new file mode 100644 (file)
index 0000000..7e774e9
--- /dev/null
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkWindow" id="window1">
+    <property name="can_focus">False</property>
+    <property name="type">popup</property>
+    <child>
+      <object class="GtkBox">
+        <property name="visible">True</property>
+        <property name="orientation">horizontal</property>
+        <child>
+          <object class="GtkLabel">
+            <property name="visible">True</property>
+            <property name="name">label1</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkLabel">
+            <property name="visible">True</property>
+            <property name="name">label2</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkLabel">
+            <property name="visible">True</property>
+            <property name="name">label3</property>
+          </object>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/testsuite/css/nodes/box.rtl.nodes b/testsuite/css/nodes/box.rtl.nodes
new file mode 100644 (file)
index 0000000..38e3e59
--- /dev/null
@@ -0,0 +1,6 @@
+[window.background:dir(rtl)]
+  decoration:dir(ltr)
+  box.horizontal:dir(rtl)
+    label#label3:dir(ltr)
+    label#label2:dir(ltr)
+    label#label1:dir(ltr)
diff --git a/testsuite/css/nodes/box.rtl.ui b/testsuite/css/nodes/box.rtl.ui
new file mode 100644 (file)
index 0000000..7e774e9
--- /dev/null
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkWindow" id="window1">
+    <property name="can_focus">False</property>
+    <property name="type">popup</property>
+    <child>
+      <object class="GtkBox">
+        <property name="visible">True</property>
+        <property name="orientation">horizontal</property>
+        <child>
+          <object class="GtkLabel">
+            <property name="visible">True</property>
+            <property name="name">label1</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkLabel">
+            <property name="visible">True</property>
+            <property name="name">label2</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkLabel">
+            <property name="visible">True</property>
+            <property name="name">label3</property>
+          </object>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>